//
//  NSTextField+Extension.swift
//  OneMeeting
//
//  Created by zhangheng on 2019/8/2.
//  Copyright © 2019 www.zhangheng.com. All rights reserved.
//

import Foundation

extension NSTextField {
    
    // label创建
    static func label(title:String,textColor:NSColor,font:NSFont) -> Self {
        let lab = Self()
        lab.backgroundColor = NSColor.clear
        lab.textColor = textColor
        lab.maximumNumberOfLines = 1
        lab.stringValue = title
        lab.font = font
        return lab
    }
    
    // label创建
    public func setLabel(title:String,textColor:NSColor,font:NSFont) {
        self.isEditable = false
        self.isBordered = false
        self.backgroundColor = NSColor.clear
        self.textColor = textColor
        self.maximumNumberOfLines = 1
        self.stringValue = title
        self.font = font
    }
}
